<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Methods</title>
		<script src="vue/vue.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="app">
			{{msg}}
			<br>
			<button type="button" @click="SayHello()">点我有惊喜</button>
			<button type="button" @click="colour('黑色')">点我有惊吓</button>
		</div>
	</body>
	
	<script type="text/javascript">
		new Vue({
			el:"#app",
			data:{
				msg:"Hello VueJS!"
			},
			methods:{//所有方法必须在此定义
				SayHello:function(){
					alert("你好呀铁汁！");
					console.log("你好呀铁汁！");
				},
				colour:function(colour){
					alert(colour+"！");
				}
			}
		});
	</script>
	
</html>
